package com.caesar.exer3;

import java.util.Date;

/**
 * @author caesar
 * @date 2025/7/21
 * @Description:
 * @apiNote
 */
public class FormatThread extends Thread {
    private final DateFormatter formatter;
    private final Date date;
    public FormatThread(DateFormatter formatter, Date date, String name) {
        super(name);
        this.formatter = formatter;
        this.date = date;
    }
    @Override
    public void run() {
        String formattedDate = formatter.format(date);
        System.out.println(Thread.currentThread().getName() + " 格式化结果: " + formattedDate);
    }
}
